<?php
if(isset($_POST["submit"]) == '')
{
?>
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>

<div id="content_wrapper">
<div id="main_content" class="cf">
<form action="" class="formEl" id="form_a" method="post">
<div class="cf sepH_c">
<div id="content_actions" class="fr">
<button class="fr next btn btn_d submitForm" name="submit" type="submit" value="Submit">Thêm</button>
<a href="javascript:void(0)" class="clear_form btn btn_a">Clear form</a>
<a href="javascript:history.go(-1)" class="btn btn_a">Cancel</a></div>

</div>

<ul class="tabsB cf">
	<li><a href="#tab-1">Thêm Đại lý</a></li>
	
</ul>

<div class="msg_box msg_error" id="form_a_errors" style="display: none"></div>

<div class="content_panes">

<div id="tab-1">

<div class="formEl_a">

<fieldset><legend>Thông tin Đại lý</legend>
    <div class="sepH_b"><label for="title" class="lbl_a">Tên</label> 
        <input	type="text" id="title" name="name" class="inpt_a" />
    </div>

	<div class="sepH_c cf"><label for="text" class="lbl_a">Địa chỉ</label> 
        <input	type="text" id="address" name="name" class="inpt_a" />
    </div>
	
    <div class="sepH_c cf"><label for="text" class="lbl_a">Số Điện thoại</label> 
        <input	type="text" id="address" name="name" class="inpt_a" />
    </div>
    <div class="sepH_c cf"><label for="text" class="lbl_a">Thành phố</label> 
        <select name="jumpMenu" id="city" onchange="MM_jumpMenu('parent',this,0)">
          <option>Hà Nội </option>
          <option>Hải Phòng </option>
          <option>Hải Dương</option>
          <option>Hồ Chí Minh</option>
          <option>Đà Nẵng</option>
          <option>Huế</option>
          <option>Cần Thơ</option>
          <option>Cà Mau</option>
          <option>Bình Dương</option>
        </select>
    </div>

</fieldset>

</div>
</div>
<div id="tab-2" class="cf formEl_a">
<div class="sepH_b cf">
<div class="dp100">


</fieldset>

</div>
</div>

</div>

</div>
</form>
</div>
</div>
<?php
} else {
	$pro->setname($_POST["name"]);
	$pro->setdescription($_POST["description"]);
	$pro->setcontent($_POST["content"]);
//	$pro->setimage();
//	$pro->setimage2();
//	$pro->setimage3($image3);
	$pro->setstatus($_POST["status"]);
	$pro->setbanchay($_POST["banchay"]);
	$pro->settieubieu($_POST["tieubieu"]);
	$pro->settinhtrang($_POST["tinhtrang"]);
	$pro->setcatid($_POST["cat_id"]);
	//echo $main->url_friend($_POST["name"]);
	//$msg = $pro->insert();
}
?>
<link rel="stylesheet" href="lib/elfinder/css/elfinder.full.css"
	type="text/css" />
<link rel="stylesheet" href="lib/fancybox/jquery.fancybox-1.3.4.css"
	type="text/css" />
<link rel="stylesheet" href="lib/file-uploader/fileuploader.css"
	type="text/css" />

<script type="text/javascript">
		head.js(
			"js/jquery-1.6.2.min.js",
			"lib/jquery-ui/jquery-ui-1.8.15.custom.min.js",
			"lib/harvesthq-chosen/chosen.jquery.min.js",
			"lib/fusion-charts/FusionCharts.js",
			"lib/fancybox/jquery.easing-1.3.pack.js",
			"lib/fancybox/jquery.fancybox-1.3.4.pack.js",
			"lib/tiny-mce/jquery.tinymce.js",
			"js/jquery.microaccordion.js",
			"js/jquery.tools.min.js",
			"js/jquery.stickyPanel.js",
			"js/xbreadcrumbs.js",
			"lib/jquery-validation/jquery.validate.js",
			"js/lagu.js",
			function(){
				lga_fusionCharts.chart_k();
				lga_flowTabs.tabs_b();
				lga_selectBox.init();
				lga_datepicker.init();
				lga_editor.init();
				lga_sticky.sticky_contentActions();
				lga_clearForm.init();			
				lga_form_a_validation.init();
			}
		)
    </script>
